package com.liuzy.project;

import mvc.core.BaseAction;
import mvc.core.annotation.Action;
import mvc.core.annotation.Inject;
import mvc.core.annotation.Mapping;
import mvc.core.log.Logger;

/**
 * 
 * @author liuzy
 * @version 2015年5月13日
 */
@Action
@Mapping("/myAction")
public class MyAction extends BaseAction {
	
	private Logger logger = Logger.getLogger(MyAction.class);
	
	@Inject
	private MyService service;
	
	@Mapping("/login")
	public Object login() {
		logger.info("MyAction login()");
		boolean flag = service.login("liuzy", "111111"); 
		if (flag)
			return "登陆成功";
		else
			return "登陆失败";
	}
	
	@Mapping("/manager")
	public Object manager() {
		logger.info("MyAction manager()");
		return service.manager();
	}

	@Mapping("/add")
	public Object add() {
		logger.info("MyAction add()");
		int i = service.add("xhy", "123");
		return i+"行受影响";
	}
}
